package com.xy.tianyu.module.picture.activity

import com.xy.tianyu.BaseActivity
import com.xy.tianyu.LazyLoadBaseFragment
import com.xy.tianyu.R
import com.xy.tianyu.module.picture.adapter.PicPageAdapter
import com.xy.tianyu.module.picture.fragment.PicHotSearchFragment
import com.xy.tianyu.module.picture.fragment.PicMoreCategoryFragment
import com.xy.tianyu.module.picture.fragment.PicSetFragment
import com.xy.tianyu.module.picture.fragment.PicTodayHotFragment
import kotlinx.android.synthetic.main.activity_picture.*

/**
 * @time 2020/10/27 14:40
 * @class 描述:
 */
class PictureActivity : BaseActivity() {
    private lateinit var fragmentList: MutableList<LazyLoadBaseFragment>
    private lateinit var titleList: MutableList<String>

    override fun showDestroyReveal(): Boolean  = true

    override fun getLayoutId(): Int {
        return R.layout.activity_picture
    }

    override fun initData() {
        tv_picture_title.setOnClickListener {
            finish()
        }

        titleList = mutableListOf(getString(R.string.ty_pic_today_hot),getString(R.string.ty_pic_hot_search),getString(R.string.ty_pic_selected_group_drawings),getString(R.string.ty_pic_more_category))
        fragmentList = mutableListOf(
            PicTodayHotFragment(),
            PicHotSearchFragment(),
            PicSetFragment(),
            PicMoreCategoryFragment()
        )
        val picPageAdapter = PicPageAdapter(supportFragmentManager,titleList, fragmentList)
        vp_pic.adapter = picPageAdapter
        tab_pic.setupWithViewPager(vp_pic)
    }
}